<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改项目成果管理')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: jasny-bootstrap-css" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
	<style>
		.file-preview {
		    padding: 0;
		    margin-bottom: 0;
		    border-radius: 0;
		    border: none;
		}
		
		.krajee-default.file-preview-frame {
		    margin-right: 20px;
		    padding: 0;
		    border: none;
		    box-shadow: none;
		}
		
		.krajee-default.file-preview-frame:not(.file-preview-error):hover {
		    border: none;
		    box-shadow: none;
		}
		
		.krajee-default .file-footer-caption {
			margin-bottom: 0;
		}
		
		.krajee-default.file-preview-frame .file-thumbnail-footer {
		    height: auto;
		}
		
		.krajee-default .file-caption-info {
			width: auto;
		}
		
		.kv-upload-progress .progress {
			margin-top: 0;
		}
		
		.krajee-default.file-preview-frame .kv-file-content,
		.krajee-default .file-size-info,
		.krajee-default .file-upload-indicator,
		.file-input .kv-file-upload,
		.file-input .kv-file-zoom {
			display: none;
		}
		
		.file-input .kv-file-remove {
			position: absolute;
			top: 3px;
			right: -15px;
			height: 14px;
			padding: 0;
			margin: 0;
			border: none;
			background: none;
		}
		
		.file-input .kv-file-remove:active, 
		.file-input .kv-file-remove:focus {
			background: none;
			outline: none;
			box-shadow: none;
		}
		
		.file-input .kv-file-remove .glyphicon-trash {
			color: red;
		}
	</style>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-reust-edit" th:object="${sjProjectReust}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="gcProjectid" type="hidden" id="gcProjectid" th:field="*{gcProjectid}">
        	<input type="hidden" id="wenj" name="wenj" th:value="${wenjvo}" />
            <input type="hidden" id="wenjvo" name="wenjvo" th:field="*{wenj}" />
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">编号：</label>
                <div class="col-sm-4">
                    <input name="orderNo" class="form-control" type="text" th:field="*{orderNo}" autoComplete="off" required />
                </div>
                <label class="col-sm-2 control-label is-required">项目名称：</label>
                <div class="col-sm-4">
                    <input name="projectName" class="form-control" type="text" th:field="*{projectName}" readonly="readonly" autoComplete="off" required/>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">资料等级：</label>
                <div class="col-sm-4">
                    <select id="level" name="level" class="form-control" th:field="*{level}" autoComplete="off" required>
						<option value="A">A</option>
						<option value="B">B</option>
						<option value="C">C</option>
					</select>
                </div>
                <label class="col-sm-2 control-label is-required">资料类型：</label>
                <div class="col-sm-4">
                    <select name="type" class="form-control" th:field="*{type}" th:with="type=${@dict.getType('sj_resultType')}" autoComplete="off" required >
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label is-required">资料内容：</label>
                <div class="col-sm-10">
                    <textarea name="descs" class="form-control" autoComplete="off" required>[[*{descs}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">文档：</label>
                <div class="col-sm-10" style="margin-top: 8px;" id="wenjlink">
                </div>
            </div>
            <div class="form-group">
	            <label class="col-sm-2 control-label font-noraml is-required">文档：</label>
	            <div class="col-sm-10">
	            	<div class="file-loading">
		            	<input id="multipleFile" name="files" type="file" multiple>
		        	</div>
	            </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: jasny-bootstrap-js" />
    <script th:src="@{/ruoyi/base64.min.js?v=20231208}"></script>
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <th:block th:include="include :: bootstrap-suggest-js" />
    <th:block th:include="include :: bootstrap-typeahead-js" />
    <script th:inline="javascript">
        var prefix = ctx + "sj/reust";
        $("#form-reust-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-reust-edit').serialize());
            }
        }
        
        $(function() {
			var zilwj = $("#wenjvo").val();
        	
        	var n=zilwj.split(",");
        	for(var i=0;i<n.length;i++){
//         		var url = "http://lkgnews.cn:8012/onlinePreview?url="+encodeURIComponent(Base64.encode(n[i]));
        		var url = n[i];
        		$("#wenjlink").append("<a href='"+url+"' target='_blank' >"+n[i]+"</a><br>");
        	}
        	
        	// 多图上传
 	       $("#multipleFile").fileinput({
 	           uploadUrl: "/common/uploads",
 	           uploadAsync: false,
 	           showClose: false,
 	           showCancel: false,
 	           dropZoneEnabled: false,
	           buttonLabelClass: ''
 	       }).on('filebatchuploadsuccess', function (event, data, previewId, index) {
 	       	var rsp = data.response;
 	           log.info("reutrn fileNames：" + rsp.fileNames)
 			   $("#wenj").val(rsp.fileNames);
 	       }).on('fileremoved', function (event, id, index) {
 	           $("input[name='" + event.currentTarget.id + "']").val('')
 	       })
        });

    </script>
</body>
</html>